<template lang="html">
    <div class="message">
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-message"></i>&nbsp;平台收货地址</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <div style="height:20px;"></div>
            <el-form v-model="formCN" label-width="150px" class="demo-ruleForm">
                <el-form-item label="平台收货名称：">
                    <el-input type="text" v-model="formCN.name" :disabled="true" style="width:500px"></el-input>
                </el-form-item>
                <el-form-item label="平台收货联系方式：">
                    <el-input type="text" v-model="formCN.mobile" :disabled="true" style="width:500px"></el-input>
                </el-form-item>
                <el-form-item label="平台收货地址：">
                    <el-input type="text" v-model="formCN.province+' '+formCN.city+' '+formCN.district+' '+formCN.address" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="平台邮编地址：">
                    <el-input type="text" v-model="formCN.zip_code" :disabled="true" style="width:500px"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="TopostAddress(1)">设置</el-button>
                </el-form-item>
            </el-form>
        </div>
        <div style="height:20px;"></div>
        <div class="container">
            <div style="height:20px;"></div>
            <el-form v-model="formEN" label-width="150px" class="demo-ruleForm">
                <el-form-item label="平台收货名称：">
                    <el-input type="text" v-model="formEN.name" :disabled="true" style="width:500px"></el-input>
                </el-form-item>
                <el-form-item label="平台收货联系方式：">
                    <el-input type="text" v-model="formEN.mobile" :disabled="true" style="width:500px"></el-input>
                </el-form-item>
                <el-form-item label="平台收货地址：">
                    <el-input type="text" v-model="formEN.province+' '+formEN.city+' '+formEN.district+' '+formEN.address" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="平台邮编地址：">
                    <el-input type="text" v-model="formEN.zip_code" :disabled="true" style="width:500px"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="TopostAddress(0)">设置</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>
</template>

<script>
import {getAddress,postAddress} from '@/api/configuration/list'
    export default {
        name: "configaddress",
        data() {
            return {
                formCN:[],//中文地址数据
                formEN:[],//英文地址数据
            }
        },
        created(){
            //获取平台地址
            this.getAddress();
        },
        mounted() {
            
        },
        methods: {
            //获取平台地址
            getAddress(){
                getAddress().then(res => {
                    this.formCN = res.data[1];//获取中文地址信息
                    this.formEN = res.data[0];//获取英文地址信息
                })
            },
            //跳转
            TopostAddress(index){
                this.$router.push({path:'/configuration/addEdit',query:{index:index}});
            },
        }
    }
</script>

<style lang="css" scoped>
.del {
    color: #f00;
}
</style>
